<div class="loader"></div>
<h3>
@if ( $result->status == Constant::PO_PENDING )
{{ $text_edit }} 
@else
{{ $text_view }} 
@endif
{{ $title }} with ID# {{ $result->id }}</h3>

<div class="row">
	<div class="col-md-3"><strong>{{ $text_po_number }}</strong></div>
	<div class="col-md-9">{{ strtoupper($result->vendor->code) }}-{{ str_pad($result->id, 3, '0', STR_PAD_LEFT) }}-{{ date_format($result->created_at, 'Ymd') }}</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_vendor }}</strong></div>
	<div class="col-md-9">{{ $result->vendor->name }}</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_company }}</strong></div>
	<div class="col-md-9">{{ strtoupper($result->company_code) }}</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_created_by }}</strong></div>
	<div class="col-md-9"></strong>{{ $result->createdBy->firstname }} {{ $result->createdBy->lastname }}
	<small>{{ $text_at }}</small> {{ $result->created_at }}</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_modified_by}}</strong></div>
	<div class="col-md-9">{{ $result->modifiedBy->firstname }} {{ $result->createdBy->lastname }} 
	<small>{{ $text_at }}</small> {{ $result->updated_at }}</div>
</div>
@if ( !empty($result->approved_by) )
<div class="row">
	<div class="col-md-3"><strong>{{ $text_approved_by }}</strong></div>
	<div class="col-md-9">{{ $result->approvedBy->firstname }} {{ $result->approvedBy->lastname }} 
		<small>{{ $text_at }}</small> {{ $result->approved_at }}</div>
	</div>
</div>
@endif
<div class="row">
	<div class="col-md-3"><strong>{{ $text_total_transfer_price }}</strong></div>
	<div class="col-md-9">{{ number_format($result->total_transfer_price,2) }}</div>
</div>
<br/>

{{ Form::model($result, array('route' => array($base . '.update', $result->id), 'method' => 'PUT', 'id' => 'form')) }}
	<div class="form-group">
		<!-- Update -->
		@if ( $result->status == Constant::PO_PENDING && 
			( Auth::user()->userGroup->level == Constant::USER_MANAGER ))
			{{ Form::label('status', $form_status) }}
			{{ Form::select('status', $statuses, Input::old('status'), array('class' => 'form-control')) }}
			
			{{ Form::label('comment', $form_comment) }}
			{{ Form::textarea('comment', Input::old('comment'), array('class' => 'form-control', 'size' => '30x4')) }}
			
			<span class="error text-danger" id="error_comment"></span>
			<br>
			{{ Form::submit($text_submit, array('class' => 'btn btn-primary', 'id'=> 'submit', 'data-loading-text' => $text_loading)) }}
		<!-- View -->
		@else
			<div class="row">
				<div class="col-md-3"><strong>{{ $text_comment }}</strong></div>
				<div class="col-md-9">
					@if ( !empty($result->comment) ) {{ $result->comment }}
					@else N/A
					@endif
				</div>
			</div>
			<br>
		@endif
		<a href='{{ URL::to("po/export/{$result->id}/default/1") }}' class="btn btn-primary">Download Supplier PO</a>
		<a href='{{ URL::to("po/export/{$result->id}/acommerce/1") }}' class="btn btn-primary">Download Acommerce PO</a>
		{{ HTML::link( URL::previous(), $text_close, array('class' => 'btn btn-default', 'id'=> 'cancel')) }}
	</div>
{{ Form::close() }}






